#include <stdint.h>
#include <stdlib.h>

#include <iostream>
#include <string>
#include <tuple>

template <typename TupleType>
void DisplayTupleInfo(TupleType& tup) {
  const int64_t num = std::tuple_size<TupleType>::value;
  std::cout << "num: " << num << std::endl;
  std::cout << "last: " << std::get<num - 1>(tup) << std::endl;
  return;
}

int main(int argc, char const* argv[]) {
  std::tuple<int64_t, char, std::string> t1(std::make_tuple(101, 's', "hello"));
  DisplayTupleInfo(t1);

  auto t2(std::make_tuple(3.14, false));
  DisplayTupleInfo(t2);

  auto t3(std::tuple_cat(t2, t1));
  DisplayTupleInfo(t3);

  double p1 = 0;
  std::string p2 = "";
  std::tie(p1, std::ignore, std::ignore, std::ignore, p2) = t3;
  std::cout << "p1: " << p1 << std::endl;
  std::cout << "p2: " << p2 << std::endl;

  return EXIT_SUCCESS;
}